# 导入随机数模块
import random

# 石头(1) 剪刀(2) 布(3)
player = int(input('请输您的拳头:'))
# 生成一个随机整数
# random.randint(a,b) 随机数包含a或b
component = random.randint(1, 3)

player_str = ''
component_str = ''
if player == 1:
    player_str = '石头'
elif player == 2:
    player_str = '剪刀'
else:
    player_str = '布'


if component == 1:
    component_str = '石头'
elif component == 2:
    component_str = '剪刀'
else:
    component_str = '布'

print('玩家选择的是%s - 电脑选择的是%s' % (player_str, component_str))

if (
        (player == 1 and component == 2)
        or (player == 2 and component == 3)
        or (player == 3 and component == 1)
):
    print('玩家胜利!')
elif player == component:
    print('心有灵犀!')
else:
    print('电脑胜利!')
